ScxV6Object.Copy Method
Copies a database object, returning an ScxV6Object object representing the new database object.
Parameters
- NewParentId
The identifier of the target database group where the new copy is created.
Returns
Returns an ScxV6Object object representing the copied database object.
Remarks
The Copy method creates a copy of an existing database object. The existing object may be a single object, such as a point or a mimic, or it could be a group containing other objects.
The copy operation may fail if:
- The NewParentId argument does not refer to a group object.
- The user does not have configuration privileges for the target group object.
- The object being copied is not allowed in the target object. For example you cannot copy a template into another template.
The following example written in VB.NET shows the Copy method being used to copy a point from the root into a sub-group:
' Connect to the server
Dim Svr As ScxV6DbClient.ScxV6Server
Svr = New ScxV6DbClient.ScxV6Server
Svr.Connect("MAIN", "", "")
' Find the point we wish to copy
Dim Obj As ScxV6DbClient.ScxV6Object
Obj = Svr.FindObject("Test Point")
' Find the destination group
Dim Group As ScxV6DbClient.ScxV6Object
Group = Svr.FindObject("Group")
' Move the point into the root
Obj.Copy(Group.ID)
' Disconnect
Svr.Disconnect()